//
//  UserInfoModel.m
//  CreditHub
//
//  Created by xinhualong on 2024/9/14.
//

#import "UserInfoModel.h"
#import "CacheTool.h"
#import "LoginViewController.h"

@implementation UserInfoModel
//获取用户
+ (UserInfoModel *)getUserInfo {

    return [[CacheTool sharedInstance] getUserInfo];
}
+(BOOL)isLogin{
    if(!CHStringIsEmpty([UserInfoModel getUserInfo].areal)){
        return YES;
    }
    return NO;
}
+(void)login{
    LoginViewController *vc = [[LoginViewController alloc] init];
    [[UIView xhl_getTopViewController].navigationController pushViewController:vc animated:YES];

}
+(void)logout{
    
    [[CacheTool sharedInstance] updateUsetInfo:@{}];
    [[NSNotificationCenter defaultCenter] postNotificationName:NotificationBackHomeKey object:@{@"index":@(0)}];
    
}
@end
